package com.iwunu.gateway.entity;

import javax.persistence.*;
import com.iwunu.iot.common.util.DateUtil;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Entity
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Table(name="t_flock_user")
public class FLockUser {
	@Id
	private Long  id;
	private String  nickName;
	private String phone;
	private String avatar;
	private String uuid;
	private String openId;
    private String token;
    private String  createTime;
    private String lastLoginTime;
	@Id
	@Column(name = "id",columnDefinition="bigint(18) COMMENT '主键，自动生成'")
	@GeneratedValue(strategy= GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
    public FLockUser(String phone) {
        this.phone = phone;
        this.createTime=DateUtil.nowDateTime();
        this.lastLoginTime=DateUtil.nowDateTime();
    }

    public FLockUser(String phone,String openId) {
        this.openId = openId;
        this.createTime=DateUtil.nowDateTime();
        this.lastLoginTime=DateUtil.nowDateTime();
    }
}
